package com.gscitysfy.cus.drain.modules.reserveplan.controller;


import com.gscitysfy.cloudfrmwk.assistant.domain.Result;
import com.gscitysfy.cus.drain.modules.reserveplan.entity.DrainReservePlanControlInfo;
import com.gscitysfy.cus.drain.modules.reserveplan.entity.DrainReservePlanLevelResponse;
import com.gscitysfy.cus.drain.modules.reserveplan.service.IDrainReservePlanControlInfoService;
import com.gscitysfy.cus.drain.modules.reserveplan.service.IDrainReservePlanLevelResponseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 预案等级对应的划分标准和响应机制信息表 前端控制器
 * </p>
 *
 * @author shenglin
 * @since 2022-11-15 14:28:05
 */
@RestController
@RequestMapping("/reserveplan/drain-reserve-plan-level-response")
@Tag(name = "预案管理-预案等级和响应机制")
public class DrainReservePlanLevelResponseController {

    @Autowired
    IDrainReservePlanLevelResponseService drainReservePlanLevelResponseService;

    /**
     * 新增预案等级和响应机制
     *
     * @param drainReservePlanLevelResponse
     * @return
     */
    @PostMapping("/saveReservePlanLevelResponse")
    @Operation(summary = "新增预案等级和响应机制", description = "新增预案等级和响应机制")
    public Result saveReservePlanLevelResponse(@RequestBody DrainReservePlanLevelResponse drainReservePlanLevelResponse) {
        return Result.content(drainReservePlanLevelResponseService.saveOrUpdate(drainReservePlanLevelResponse));
    }


    /**
     * 获取预案等级和响应机制
     *
     * @param infoId
     * @return
     */
    @PostMapping("/getReservePlanLevelResponse")
    @Operation(summary = "获取预案等级和响应机制", description = "获取预案等级和响应机制")
    @Parameters({
            @Parameter(required = true, name = "infoId", description = "预案id"),
    })
    public Result getReservePlanInfoList(String infoId) {
        return Result.content(drainReservePlanLevelResponseService.getById(infoId));
    }
}
